{extend name="index/iframe" /}

{block name="content"}
<div style="padding: 0 10px;">
    <form class="layui-form" action="">
        <input type="hidden" value="{$Think.get.id}" name="id">
        <table class="layui-table">
            <tr>
                <td style="text-align: right;">渠道名称：</td>
                <td style="padding-left:25px;">{$bill.channel_id}：{$bill.channel_name}</td>
            </tr>
            <tr>
                <td style="text-align: right;">对账日期：</td>
                <td style="padding-left:25px;">{$bill.start_time} - {$bill.end_time}</td>
            </tr>
            <tr>
                <td style="width: 200px; text-align: right;">米娱渠道充值总额：</td>
                <td><input type="text" value="{$bill.sdk_fixed_price}" id="sdk_fixed_price" placeholder="0.00" autocomplete="off" class="layui-input layui-disabled"></td>
            </tr>
            <tr>
                <td style="width: 200px; text-align: right;">对方渠道充值总额：</td>
                <td><input type="text" value="{$bill.other_fixed_price}" name="other_fixed_price" id="other_fixed_price" placeholder="0.00" autocomplete="off" class="layui-input"></td>
            </tr>
            <tr>
                <td style="width: 200px; text-align: right;">米娱渠道回款总额：</td>
                <td><input type="text" value="{$bill.all_total_price}" id="all_total_price" placeholder="0.00" autocomplete="off" class="layui-input layui-disabled"></td>
            </tr>
            <tr>
                <td style="width: 200px; text-align: right;">对方渠道回款总额：</td>
                <td><input type="text" value="{$bill.other_total_price}" name="other_total_price" id="other_total_price" placeholder="0.00" autocomplete="off" class="layui-input"></td>
            </tr>
            <tr>
                <td style="text-align: right;">是否发票：</td>
                <td><input type="checkbox" {$bill.open_invoice==1 ? 'checked' : ''} name="open_invoice" lay-skin="switch" lay-filter="switchTest" lay-text="是|否"></td>
            </tr>
            <tr>
                <td style="text-align: right;">快递信息</td>
                <td><input type="text" value="{$bill.send_info}" name="send_info" id="send_info" placeholder="快递编号" autocomplete="off" class="layui-input"></td>
            </tr>
            <tr>
                <td style="text-align: right;">寄件日期</td>
                <td><input type="text" value="{$bill.send_time}" name="send_time" id="date" placeholder="yyyy-MM-dd" autocomplete="off" class="layui-input"></td>
            </tr>
            <tr>
                <td style="text-align: right;"></td>
                <td><button class="layui-btn my-btn" lay-submit="" lay-filter="submitBtn">提交</button></td>
            </tr>
        </table>
    </form>

</div>
{/block}

{block name="css"}
<style>
    .layui-form-switch {margin-top: 0px;}
</style>
{/block}

{block name="js"}
<script>
    layui.use(['form', 'layedit', 'laydate'], function(){
        var $ = layui.$
            ,form = layui.form
            ,layer = layui.layer
            ,layedit = layui.layedit
            ,laydate = layui.laydate;

        laydate.render({
            elem: '#date'
        });

        $('#other_fixed_price').blur(function(){
            var other_fixed_price = $(this).val()
                ,sdk_fixed_price = $('#sdk_fixed_price').html();

            $('#diff_price').html(other_fixed_price-sdk_fixed_price);
        })

        //提交
        form.on('submit(submitBtn)', function(data){
            var load = layer.load();
            $.post('{:url("AuditSdkMng/info")}',data.field, function(json){
                layer.close(load);
                json.code==0 ? layer.msg(json.msg, {icon: 1, time: 1000}) : layer.msg(json.msg, {icon: 0, time: 1000});
            }, 'JSON').error(function(){
                layer.close(load);
                layer.msg('连接超时，请联系后台管理员', {icon: 2, time:3000});
            });
            return false;
        });
    });
</script>
{/block}